package com.yanqu.road.entity.rank.xrank;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.math.BigInteger;

@FieldTypeAnnotation(tableName = "t_u_xrank_season_user")
public class XSeasonStageUserRank {

    @FieldTypeAnnotation(desc = "系统ID", select = true, update = true)
    private int systemId;
    @FieldTypeAnnotation(desc = "赛季ID", select = true, update = true)
    private int seasonId;
    @FieldTypeAnnotation(desc = "类型", select = true, update = true)
    private int conditionType;
    @FieldTypeAnnotation(desc = "阶段", select = true, update = true)
    private int stage;
    @FieldTypeAnnotation(desc = "范围key", select = true, update = true)
    private String rangeKey;

    @FieldTypeAnnotation(desc = "排名")
    private int rank;
    @FieldTypeAnnotation(desc = "渠道ID")
    private int channelId;
    @FieldTypeAnnotation(desc = "区服ID")
    private long serverId;
    @FieldTypeAnnotation(desc = "玩家ID")
    private long userId;
    @FieldTypeAnnotation(desc = "玩家信息")
    private UserBaseInfo baseInfo;
    @FieldTypeAnnotation(desc = "拓展参数")
    private String param = "";
    @FieldTypeAnnotation(desc = "排行值")
    private BigInteger value = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "更新时间")
    private long lastUpdateTime;

    /**
     * 替换
     */
    public void replace(XSeasonStageUserRank tmpUserRank) {
        setSystemId(tmpUserRank.getSystemId());
        setSeasonId(tmpUserRank.getSeasonId());
        setConditionType(tmpUserRank.getConditionType());
        setStage(tmpUserRank.getStage());
        setRangeKey(tmpUserRank.getRangeKey());
        setChannelId(tmpUserRank.getChannelId());
        setServerId(tmpUserRank.getServerId());
        setUserId(tmpUserRank.getUserId());
        setBaseInfo(tmpUserRank.getBaseInfo());
        setValue(tmpUserRank.getValue());
        setParam(tmpUserRank.getParam());
        setLastUpdateTime(tmpUserRank.getLastUpdateTime());
    }

    public XSeasonStageUserRank clone() {
        XSeasonStageUserRank userRank = new XSeasonStageUserRank();
        userRank.setSystemId(getSystemId());
        userRank.setSeasonId(getSeasonId());
        userRank.setConditionType(getConditionType());
        userRank.setStage(getStage());
        userRank.setRangeKey(getRangeKey());
        userRank.setChannelId(getChannelId());
        userRank.setServerId(getServerId());
        userRank.setUserId(getUserId());
        userRank.setBaseInfo(getBaseInfo());
        userRank.setValue(getValue());
        userRank.setLastUpdateTime(getLastUpdateTime());
        userRank.setParam(getParam());
        return userRank;
    }

    public XSeasonStageUserRank() {

    }

    public XSeasonStageUserRank(XSeasonUserRank xSeasonUserRank, int stage) {
        this.systemId = xSeasonUserRank.getSystemId();
        this.seasonId = xSeasonUserRank.getSeasonId();
        this.conditionType = xSeasonUserRank.getConditionType();
        this.stage = stage;
        this.rangeKey = xSeasonUserRank.getRangeKey();
        this.rank = xSeasonUserRank.getRank();
        this.channelId = xSeasonUserRank.getChannelId();
        this.serverId = xSeasonUserRank.getServerId();
        this.userId = xSeasonUserRank.getUserId();
        this.baseInfo = xSeasonUserRank.getBaseInfo();
        this.param = xSeasonUserRank.getParam();
        this.value = xSeasonUserRank.getValue();
        this.lastUpdateTime = xSeasonUserRank.getLastUpdateTime();
    }

    public int getSystemId() {
        return systemId;
    }

    public void setSystemId(int systemId) {
        this.systemId = systemId;
    }

    public int getSeasonId() {
        return seasonId;
    }

    public void setSeasonId(int seasonId) {
        this.seasonId = seasonId;
    }

    public String getRangeKey() {
        return rangeKey;
    }

    public void setRangeKey(String rangeKey) {
        this.rangeKey = rangeKey;
    }

    public int getConditionType() {
        return conditionType;
    }

    public void setConditionType(int conditionType) {
        this.conditionType = conditionType;
    }

    public int getStage() {
        return stage;
    }

    public void setStage(int stage) {
        this.stage = stage;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        this.serverId = serverId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public UserBaseInfo getBaseInfo() {
        return baseInfo;
    }

    public void setBaseInfo(UserBaseInfo baseInfo) {
        this.baseInfo = baseInfo;
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public BigInteger getValue() {
        return value;
    }

    public void setValue(BigInteger value) {
        this.value = value;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}
